<!DOCTYPE html>
<html>
    <head>
        <title>保单系统--后台</title>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link href="__PUBLIC__/images/favicon.ico" rel="shortcut icon" />
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-theme.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/css/login.css" />
        <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
    </head>
    <body style="background:url(__PUBLIC__/images/{$login_background}) no-repeat center">
    	<div class="jc-login-box">
    		<div class="jc-login-tit">
    			<!--<img src="__PUBLIC__/images/475-475.png" width="150px" />-->
				<div style="font-size: 20px;font-weight: bold;margin-top: 15px;color:#657a8f;">
                    保单系统
                </div>
    		</div>
    		<div class="jc-login-cont">
                <form>
                    <div class="form-group">
                        <label for="userName">用户名：</label>
                        <input type="text" class="form-control username" id="userName" placeholder="请输入用户名">
                    </div>
                    <div class="form-group">
                        <label for="passWord">密码：</label>
                        <input type="password" class="form-control password" id="passWord" placeholder="请输入密码">
                    </div>

                    <button type="button" id="loginBtn" class="btn btn-login">登录</button>
                </form>
	    	</div>
    	</div>
	    	
        


        <script>



            $(function () {
                $("#loginBtn").click(doLogin);
                $(document).keyup(function (e) {
                    if (e.keyCode == 13) {
                        doLogin();
                    }
                });
            })

            function doLogin() {
                $.ajax({
                    url: "{:U('Admin/Login/doLogin')}",
                    data: {
                        userName: $("#userName").val(),
                        passWord: $("#passWord").val()
                    },
                    type: "post",
                    dataType: "json",
                    success: function (data) {
                        if (data) {
                            window.location.href = "{:U('Admin/Index/index')}";
                        } else {
                            common.showTip("userName","无效的用户名或密码");
                        }
                    }
                })
            }
        </script>
    </body>

</html>
